package net.vkits.common;

import org.apache.shiro.subject.Subject;

import java.util.Optional;

/**
 * Created by ethan-liu on 16/4/22.
 */
public class Utils {
    static public Optional<String> getUsername(Subject subject) {
        String username = (String) subject.getPrincipals().getPrimaryPrincipal();
        return Optional.ofNullable(username);
    }
}
